//
//  recommentOneModel.m
//  Cars' home
//
//  Created by dapeng on 15/11/29.
//  Copyright © 2015年 dapeng. All rights reserved.
//

#import "recommentOneModel.h"
#import "recommentTwoModel.h"
@implementation recommentOneModel
- (void)dealloc {
    [_focusimgArray release];
    [_newslistArray release];
    [_listArray release];
    [super dealloc];
}
- (instancetype)initWithDataSource:(NSDictionary *)data {
    self = [super init];
    if (self) {
        
        [self setValuesForKeysWithDictionary:data];
    }
    return self;
}


- (void)setValue:(id)value forUndefinedKey:(NSString *)key {
    if ([key isEqualToString:@"focusimg"]) {
        NSArray *array = value;
        NSMutableArray *mutableArray = [[NSMutableArray alloc] init];
        for (NSDictionary *dic in array) {
            recommentTwoModel *twoModel = [[recommentTwoModel alloc] initWithDataSource:dic];
            [mutableArray addObject:twoModel];
        }self.focusimgArray = [NSArray arrayWithArray:mutableArray];
    }if ([key isEqualToString:@"newslist"]) {
        NSArray *array = value;
        NSMutableArray *mutableArray = [[NSMutableArray alloc] init];
        for (NSDictionary *dic in array) {
            recommentTwoModel *twoModel = [[recommentTwoModel alloc] initWithDataSource:dic];
            [mutableArray addObject:twoModel];
        }self.newslistArray = [NSMutableArray arrayWithArray:mutableArray];
    }
 
   
    
}
- (id)valueForUndefinedKey:(NSString *)key {
    return nil;
}
@end
